import { acceptHMRUpdate, defineStore } from 'pinia'

export const useApiCache = defineStore('apiCache', () => {
  // const savedName = ref('')
  // const previousNames = ref(new Set<string>())
  // const usedNames = computed(() => Array.from(previousNames.value))
  // const otherNames = computed(() => usedNames.value.filter(name => name !== savedName.value))
  // const _material = ref([] as Material[])
  // const _contact = ref([] as Contact[])
  // const _order = ref([] as Order[])

  // function setNewName(name: string) {
  //   if (savedName.value)
  //     previousNames.value.add(savedName.value)

  //   savedName.value = name
  // }

  return {
    // setNewName,
    // otherNames,
    // savedName,
  }
})

if (import.meta.hot)
  import.meta.hot.accept(acceptHMRUpdate(useApiCache as any, import.meta.hot))
